﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using UniRlv.Utility;

namespace UniRlv.UI.Main.Widget
{
    public partial class FrmCriticalError : Form
    {
        public bool ForceHide { get; set; }
        public FrmCriticalError()
        {
            InitializeComponent();
        }

        private void FrmCriticalError_Load(object sender, EventArgs e)
        {
            ForceHide = false;
        }

        private void btnReset_Click(object sender, EventArgs e)
        {
            txtInfo.Text = "";
        }

        public void AppendLog(string s)
        {
            string info = string.Format("[{0}] {1}\r\n", DateTime.Now.ToString("HH:mm:ss"), s);
            CallCtrlWithThreadSafety.AppendText(txtInfo, info, this);
        }

        public void ClearInfo()
        {
            CallCtrlWithThreadSafety.AppendText(txtInfo, "", this);
        }

        private void FrmCriticalError_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            e.Cancel = true;
        }
    }
}
